case class {{classname}}(
{{#vars}}
  {{&name}}: {{^required}}Option[{{/required}}{{#isEnum}}{{classname}}.{{enumName}}.Value{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}}{{^hasMore}}{{#isMapModel}},{{/isMapModel}}{{/hasMore}}
{{/vars}}
{{#isMapModel}}
  additionalProperties: {{parent}}
{{/isMapModel}}
)

object {{classname}} {
  {{^vendorExtensions.hasFiles}}
  implicit lazy val {{classVarName}}JsonFormat: Format[{{classname}}] = {{^isMapModel}}Json.format[{{classname}}]{{/isMapModel}}{{#isMapModel}}{
    {{#lambda.indented_4}}{{>extensibleObjectJsonFormat}}{{/lambda.indented_4}}
  }{{/isMapModel}}
  {{/vendorExtensions.hasFiles}}
  {{#vendorExtensions.hasFiles}}
  // NOTE: The JSON format for {{classname}} was not generated because it contains a file variable which cannot be encoded to JSON.
  {{/vendorExtensions.hasFiles}}
  {{#vars}}
  {{#isEnum}}

  // noinspection TypeAnnotation
  object {{enumName}} extends Enumeration {
    {{#allowableValues}}
    {{#enumVars}}
    val {{name}} = Value({{&value}})
    {{/enumVars}}
    {{/allowableValues}}

    type {{enumName}} = Value
    implicit lazy val {{enumName}}JsonFormat: Format[Value] = Format(Reads.enumNameReads(this), Writes.enumNameWrites[this.type])
  }
  {{/isEnum}}
  {{/vars}}
}
